package org.mybatis3.demo1.dao.impl;

import org.mybatis3.demo1.dao.UserMapper;
import org.mybatis3.demo1.pojo.User;
import org.mybatis3.util.MyBatisUtil;

import java.util.List;
import java.util.Map;

public class UserMapperImpl implements UserMapper{

    UserMapper userMapper= MyBatisUtil.getSqlSession().getMapper(UserMapper.class);


    @Override
    public User getOneUser(Integer id) {
        if (id<0){
            return null;
        }
        User user=userMapper.getOneUser(id);
        return user;
    }

    @Override
    public List<User> searchUser(String userName, Long userRole) {
        return userMapper.searchUser(userName,userRole);
    }

    @Override
    public List<User> searchUser2(String userName, Long userRole) {
        return userMapper.searchUser(userName,userRole);
    }

    @Override
    public List<User> searchUserByMap(Map<String, String> map) {
        return userMapper.searchUserByMap(map);
    }


    @Override
    public List<User> getUserList() {
        return userMapper.getUserList();
    }

    @Override
    public int save(User user) {
        return userMapper.save(user);
    }

    @Override
    public int delete(Integer id) {
        return userMapper.delete(id);
    }

    @Override
    public List<User> getUserAndRoleName() {
        return userMapper.getUserAndRoleName();
    }

    @Override
    public List<User> getuserAndRole() {
        return userMapper.getuserAndRole();
    }

    @Override
    public List<User> getUsersAndAddress() {
        return userMapper.getUsersAndAddress();
    }

    @Override
    public List<User> getUsersByRole(List<Long> ids) {
        return null;
    }


    @Override
    public List<User> getUsersByRoleAndUserName(Map<String, Object> map) {
        return null;
    }
}
